﻿<div class="row">
    <div class="col-xs-12 col-md-12 col-lg-12">
        <div class="widget">
            <div class="widget-header bg-blue">
            	<i class="widget-icon fa fa-arrow-left"></i>
                <span class="widget-caption">手工提成</span>
                <div class="widget-buttons">
                    <a href="#" data-toggle="maximize">
                        <i class="fa fa-expand"></i>
                    </a>
                    <a href="#" data-toggle="collapse">
                        <i class="fa fa-minus"></i>
                    </a>
                    <a href="#" data-toggle="dispose">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="widget-body" style="height: auto;">
	
				
				
				<table class="table table-hover table-striped table-bordered">
                    <thead class="bordered-blueberry">
                        <tr role="row">
                        	<th style="width: 30px;">

                        	</th>
                        	<th >ID</th>
                        	<th>订单号</th>
							<th>阿姨姓名</th>
							<th>阿姨电话</th>
							<th>银行</th>
							<th>银行卡号</th>
                        	<th>状态</th>
							<th>提现金额</th>
							<th>提现时间</th>
                        	<th >操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<volist name="cache" id="vo">
                    		<tr>
                    			<td>
									<div class="checkbox" style="margin-bottom: 0px; margin-top: 0px;">
										<label style="padding-left: 4px;"> <input name="checkvalue" type="checkbox" class="colored-blue bb-check" value="{$vo.id}">
	                                     <span class="text"></span>
										</label>                                    
	                                </div>
								</td>
                    			<td>{$vo.id}</td>
								<td>{$vo.order_num}</td>
								<td>{$vo.name}</td>
								<td>{$vo.phone}</td>
								<td>{$vo.bankmc}</td>
								<td>{$vo.bankkh}</td>
								<td>
								
									<if condition="$vo['status'] eq 0">
										未提现!
									<else />
										已提现!
									</if>
								
	
								</td>
								
								<td>{$vo.money}</td>
								<td>{$vo.addtime}</td>
								
                    			
                    			
                    			<td align="center" >
                    				<a  href="{:U('Admin/Index/doaytc',array('id'=>$vo['id']))}" class="btn btn-info btn-xs fff_ddx" ><i class="fa fa-edit"></i> 给阿姨提成 </a>
									
                    			</td>
                    		</tr>
                    	</volist>
                    </tbody>
                </table>
               <div class="row DTTTFooter">{$page}</div>
            </div>
        </div>
    </div>
</div>
<!--表单验证与提交封装-->
<script type="text/javascript">
	$('.fff_ddx').click(function (){
		var abcd = this;
		$.get($(this).attr('href'), function(data){
			abc(data);
		});
		
		function abc(data){
			if(data == 2){
				alert('已提成');
				$(abcd).html('已提成');
				return false;
			}
			
			if(data == 1){
				alert('提成成功');
				$(abcd).html('提成成功');
				return false;
			}else{
			   alert('提成失败');
			   return false;
			}
		};
		
		
		
		
		
		
		
		return false;
	});
</script>


<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>

<script type="text/javascript">
	//全选
	var checkall=$('.bb-checkall');
	var checks=$('.bb-check');
	var trs=$('table tbody tr');
	$(checkall).on('click',function(){
		if($(this).is(":checked")){			
			$(checks).prop("checked","checked");
		}else{
			$(checks).removeAttr("checked");
		}		
	});
	$(trs).on('click',function(){
		var c=$(this).find("input[type=checkbox]");
		if($(c).is(":checked")){
			$(c).removeAttr("checked");
		}else{
			$(c).prop("checked","checked");
		}		
	});
	
	//删除数据库中的菜单
	$('.delete').on('click',function(){
		var id=$(this).data('id');
		var tourl="{:U('Admin/User/role_del')}";
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				$('#refresh-toggler').trigger('click');
				return false;
			};
			$.bb.ajax('post',tourl,{'id':id},callok,callerr);
		}						
		$.bb.confirm("确认要删除吗？",funok);
	});
</script>